<template>
	<view class="store-home">
		<scroll-view class="main" scroll-y="true" @scroll="scrollHome" @scrolltolower="getAllGoods()">
			<u-swiper :list="slideshowlist" height="940"></u-swiper>

			<!-- 热卖推荐 -->
			<view id="guarantee" class="recommend">
				<view class="top">
					<view class="title">热卖推荐</view>
					<view class="subtitle">
						<span></span>
						<text>HOT SALES</text>
						<span></span>
					</view>
				</view>

				<view class="swiper-3d">
					<swiper :current="swiper.current" class="s-container" @change="swiperChange"
						:circular="swiper.circular" :indicator-dots="swiper.indicatorDots" :interval="swiper.interval"
						:duration="swiper.duration" previous-margin="97rpx" next-margin='97rpx'>
						<swiper-item class="swiper-item" v-for="(item,index) in storeinfo.recommend" :key="index">
							<image class="item-img" :src="item.image" :class="swiper.current == index?'active':''">
							</image>
						</swiper-item>
					</swiper>
					<view class="text">
						<view class="name">
							{{storeinfo.recommend[swiper.current].store_name}}
						</view>
						<view class="price">{{ storeinfo.recommend[swiper.current].price }}</view>
					</view>
				</view>


				<view class="recommend-goods">
					<view class="item" v-for="(item, index) in storeinfo.recommend" :key="index"
						@click="goGoodsDetail(item)">
						<image :src="item.image" mode=""></image>
						<view class="name">{{ item.store_name }}</view>
						<view class="price">{{ item.price }}</view>
					</view>
				</view>
			</view>


			<!-- 店铺栏 -->
			<view class="store">
				<image style="background-color: #FFFFFF;" :src="storeinfo.mer_avatar"></image>
				<view class="text">
					<text class="name">{{ storeinfo.mer_name }}</text>
					<view class="score">
						<u-rate :disabled="true" size="24" :count="count" v-model="storeinfo.product_score"></u-rate>
						<span
							style="padding-left: 10rpx; font-size: 26rpx;color: #000000;">{{ storeinfo.product_score }}</span>
					</view>
				</view>
				<view class="goodssum">
					<view class="sum">{{ storeinfo.totalProduct }}</view>
					<view class="ww">全部商品</view>
				</view>
			</view>

			<!-- 商品 -->
			<view class="goods-wrap">
				<view class="top">
					<view class="title">全部商品</view>
					<view class="subtitle">
						<span></span>
						<text>HOT SALES</text>
						<span></span>
					</view>
				</view>
				<view v-if="allgoods.length" :class="{ column: isColumn }" class="goods">
					<view v-for="item in allgoods" :key="item.product_id" class="item"
						@click="goGoodsDetail(item)">
						<view class="image">
							<image :src="item.image"></image>
						</view>
						<view class="text">
							<view class="name">{{ item.store_name }}</view>
							<view class="money-wrap">
								<view class="label">
									<view class="ticket" v-if="item.issetCoupon">{{ i18n.Get }}</view>
									<view class="ticket">{{ i18n.Importedgoods }}</view>
									<view class="ticket">{{ i18n.Crossborderdirect }}</view>
									<view class="pinkage">{{ i18n.Pinkage }}</view>
								</view>
								<view class="money">
									<span class='price'>¥
										<text>{{ item.price }}</text> <i>已售{{item.sales}}件</i></span>
									<span class='buy' @click.stop='joinCart(item)'>立即购买</span>
								</view>
							</view>
							<view class="score">{{ item.rate }}{{ i18n.Score }}
								{{ item.reply_count }}{{ i18n.Comments }}
							</view>
						</view>
						<view v-if="item.max_extension" class="foot">
							<text v-show="!isColumn" class="iconfont"></text>
							{{ i18n.Earn }} ¥{{ item.max_extension }}
						</view>
					</view>
				</view>
			</view>
			<view style="text-align: center; margin-bottom: 10rpx; font-size: 24rpx;">{{ loadTitle }}</view>
		</scroll-view>
		<productWindow :attr="attr" :idindex="1" :isShow="1" :iSplus="1" @myevent="onMyEvent" @ChangeAttr="ChangeAttr"
			@ChangeCartNum="ChangeCartNum" @attrVal="attrVal" @iptCartNum="iptCartNum" @goCat='goCat' id="product-window">
		</productWindow>
	</view>
</template>
<script>
	import productWindow from '@/components/productWindow/index.vue';
	import {
		getProductDetail,
		postCartAdd
	} from '@/api/store.js';
	import {
		mapGetters
	} from 'vuex';
	const globalData = getApp().globalData;
	export default {
		components: {
			productWindow
		},
		props: {
			slideshowlist: '', //轮播列表
			storeinfo: '',
			allgoods: '',
			loadTitle: '',
			isColumn: true,
		},
		data() {
			return {
				storeHeight: '',
				mer_id: globalData.mer_id,
				count: 5.0,
				currentIndex: 0,
				swiper: {
					current: 0,
					circular: true,
					indicatorDots: false,
					autoplay: true,
					interval: 3000,
					duration: 500,
				},
				cart_num: 1, //购买数量
				isOpen: false, //是否打开属性组件
				productValue: [], //系统属性
				attrValue: '', //已选属性
				attrTxt: '请选择', //属性页面提示attrTxt
				attr: {
					cartAttr: false,
					productAttr: [],
					productSelect: {}
				},
				goodsitem: [],
			};
		},
		computed: {
			i18n() {
				return globalData.$t('home');
			},
			...mapGetters(['isLogin'])
		},
		created: function() {},
		methods: {
			// 去商品详情页
			gouser: function(id) {
				this.$util.Tips({
					title: '请登陆授权！'
				});
				setTimeout(function(){
					uni.switchTab({
						url: `/pages/user/index`
					})
				},1000)
				
			},
			iptCartNum: function(e) {
				this.$set(this.attr.productSelect, 'cart_num', e);
			},
			attrVal(val) {
				this.$set(this.attr.productAttr[val.indexw], 'index', this.attr.productAttr[val.indexw].attr_values[val.indexn]);
			},
			selecAttr: function() {
				this.$set(this.attr, 'cartAttr', true);
				this.$set(this, 'isOpen', true);
			},
			onMyEvent: function() {
				this.$set(this.attr, 'cartAttr', false);
				this.$set(this, 'isOpen', false);
			},
			getdetail: function(id) {
				uni.showLoading({
					title: this.i18n.Loading,
					mask: true
				});
				let that = this;
				getProductDetail(id)
					.then(res => {
						uni.hideLoading();
						that.$set(that.attr, 'productAttr', res.data.attr);
						that.$set(that, 'productValue', res.data.sku);
						that.$set(that, 'goodsitem', res.data);
						that.DefaultSelect();
						that.goCat(true);
					})
					.catch(err => {
						that.$util.Tips({
							title: err
						});
					});
			},
			joinCart: function(e) {
				if(this.isLogin){
					this.getdetail(e.product_id)
				}else{
					this.gouser()
				}
			},
			goCat: function(news) {
				let that = this,
					productSelect = that.productValue[this.attrValue];
				//打开属性
				if (that.attrValue) {
					//默认选中了属性，但是没有打开过属性弹窗还是自动打开让用户查看默认选中的属性
					that.attr.cartAttr = !that.isOpen ? true : false;
				} else {
					if (that.isOpen) that.attr.cartAttr = true;
					else that.attr.cartAttr = !that.attr.cartAttr;
				}
				//只有关闭属性弹窗时进行加入购物车
				if (that.attr.cartAttr === true && that.isOpen === false) return (that.isOpen = true);
				//如果有属性,没有选择,提示用户选择
				if (that.attr.productAttr.length && that.isOpen === true && productSelect.stock == 0)
					return that.$util.Tips({
						title: '产品库存不足，请选择其它'
					});
				if (that.attr.productSelect.cart_num == 0) {
					return that.$util.Tips({
						title: '购买个数不能为0!'
					});
				}
				let q = {
					mer_id: that.mer_id,
					is_new: news === undefined ? 0 : 1,
					product_id: that.goodsitem.product_id,
					cart_num: that.attr.productSelect.cart_num,
					product_attr_unique: that.attr.productSelect !== undefined ? that.attr.productSelect.unique :'',
				};

				//添加购物车
				postCartAdd(q)
					.then(function(res) {
						that.isOpen = false;
						that.attr.cartAttr = false;
						if (news) {
							uni.navigateTo({
								url: '/pages/users/order_confirm/index?cartId=' + res.data.cart_id
							});
						} else {
							that.$util.Tips({
								title: '添加购物车成功',
								success: () => {
									that.getCartCount(true);
								}
							});
						}
					})
					.catch(res => {
						that.isOpen = false;
						return that.$util.Tips({
							title: res
						});
					});
			},
			ChangeAttr: function(res) {
				let productSelect = this.productValue[res];
				if (productSelect && productSelect.stock > 0) {
					this.$set(this.attr.productSelect, 'image', productSelect.image ? productSelect.image : this.goodsitem.image);
					this.$set(this.attr.productSelect, 'price', productSelect.price);
					this.$set(this.attr.productSelect, 'stock', productSelect.stock);
					this.$set(this.attr.productSelect, 'unique', productSelect.unique);
					this.$set(this.attr.productSelect, 'cart_num', 1);
					this.$set(this, 'attrValue', res);
					this.$set(this, 'attrTxt', this.i18n.Selected);
				} else {
					this.$set(this.attr.productSelect, 'image', this.goodsitem.image);
					this.$set(this.attr.productSelect, 'price', this.goodsitem.price);
					this.$set(this.attr.productSelect, 'stock', 0);
					this.$set(this.attr.productSelect, 'unique', '');
					this.$set(this.attr.productSelect, 'cart_num', 0);
					this.$set(this, 'attrValue', '');
					this.$set(this, 'attrTxt', this.i18n.Pleaseselect);
				}
			},
			/**
			 * 默认选中属性
			 *
			 */
			DefaultSelect: function() {
				let productAttr = this.attr.productAttr;
				let value = [];
				let arr = [];
				let unSortArr = [];
				for (var key in this.productValue) {
					if (this.productValue[key].stock > 0) {
						value = this.attr.productAttr.length ? key.split(',') : [];
						break;
					}
				}
				for (let i = 0; i < productAttr.length; i++) {
					this.$set(productAttr[i], 'index', value[i]);
				}
				let productSelect = this.productValue[value.join(',')];
				if (productSelect && productAttr.length) {
					this.$set(this.attr.productSelect, 'store_name', this.goodsitem.store_name);
					this.$set(this.attr.productSelect, 'image', productSelect.image ? productSelect.image : this.goodsitem.image);
					this.$set(this.attr.productSelect, 'price', productSelect.price);
					this.$set(this.attr.productSelect, 'stock', productSelect.stock);
					this.$set(this.attr.productSelect, 'unique', productSelect.unique);
			
					this.$set(this, 'attrValue', value.join(','));
					this.$set(this, 'attrTxt', this.i18n.Selected);
					if (productSelect.stock == 0) {
						this.$set(this.attr.productSelect, 'cart_num', 0);
					} else {
						this.$set(this.attr.productSelect, 'cart_num', 1);
					}
				} else if (!productSelect && productAttr.length) {
					this.$set(this.attr.productSelect, 'store_name', this.goodsitem.store_name);
					this.$set(this.attr.productSelect, 'image', this.goodsitem.image);
					this.$set(this.attr.productSelect, 'price', this.goodsitem.price);
					this.$set(this.attr.productSelect, 'stock', 0);
					this.$set(this.attr.productSelect, 'unique', '');
					this.$set(this.attr.productSelect, 'cart_num', 0);
					this.$set(this, 'attrValue', '');
					this.$set(this, 'attrTxt', this.i18n.Pleaseselect);
				} else if (!productSelect && !productAttr.length) {
					this.$set(this.attr.productSelect, 'store_name', this.goodsitem.store_name);
					this.$set(this.attr.productSelect, 'image', this.goodsitem.image);
					this.$set(this.attr.productSelect, 'price', this.goodsitem.price);
					this.$set(this.attr.productSelect, 'stock', this.goodsitem.stock);
					this.$set(this.attr.productSelect, 'unique', this.goodsitem.unique || '');
					this.$set(this.attr.productSelect, 'cart_num', 1);
					this.$set(this, 'attrValue', '');
					this.$set(this, 'attrTxt', this.i18n.Pleaseselect);
				} else if (productSelect && !productAttr.length) {
					this.$set(this.attr.productSelect, 'store_name', this.goodsitem.store_name);
					this.$set(this.attr.productSelect, 'image', productSelect.image);
					this.$set(this.attr.productSelect, 'price', productSelect.price);
					this.$set(this.attr.productSelect, 'stock', productSelect.stock);
					this.$set(this.attr.productSelect, 'unique', productSelect.unique);
			
					this.$set(this, 'attrValue', value.join(','));
					this.$set(this, 'attrTxt', this.i18n.Selected);
					if (productSelect.stock == 0) {
						this.$set(this.attr.productSelect, 'cart_num', 0);
					} else {
						this.$set(this.attr.productSelect, 'cart_num', 1);
					}
				}
			},
			
			//购物车数量加和数量减
			
			ChangeCartNum: function(changeValue) {
				//changeValue:是否 加|减
				//获取当前变动属性
				let productSelect = this.productValue[this.attrValue];
				//如果没有属性,赋值给商品默认库存
				if (productSelect === undefined && !this.attr.productAttr.length) productSelect = this.attr.productSelect;
				//无属性值即库存为0；不存在加减；
				if (productSelect === undefined) return;
				let stock = productSelect.stock || 0;
				let num = this.attr.productSelect;
				if (changeValue) {
					num.cart_num++;
					if (num.cart_num > stock) {
						this.$set(this.attr.productSelect, 'cart_num', stock);
						this.$set(this, 'cart_num', stock);
					}
				} else {
					num.cart_num--;
					if (num.cart_num < 1) {
						this.$set(this.attr.productSelect, 'cart_num', 1);
						this.$set(this, 'cart_num', 1);
					}
				}
			},

			swiperChange(e) {
				this.swiper.current = e.detail.current;
			},

			//获得全部商品
			getAllGoods: function() {
				this.$emit("getAllGoods", this.getAllGoods);
			},
			//去详情页
			goGoodsDetail: function(val) {
				this.$emit('goGoodsDetail', val);
			},
			// 商铺首页滚动 navbar 吸顶
			scrollHome: function(e) {
				this.$emit('scrollHome', e.detail.scrollTop >= this.storeHeight);
			}
		},
		mounted: function() {
			const query = uni.createSelectorQuery().in(this);
			query
				.select('#guarantee')
				.boundingClientRect(data => {
					this.storeHeight = data.top;
				})
				.exec();
		},
	};
</script>
<style lang="scss" scoped>
	.float {
		position: fixed;
		right: 30rpx;
		bottom: 150rpx;

		image {
			width: 80rpx;
			height: 80rpx;
		}
	}

	.store-home {
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		left: 0;
		display: flex;
		flex-direction: column;
		background: left top/750rpx 360rpx no-repeat fixed;
		overflow: hidden;



		//品质保证
		.recommend {
			background-color: #F6E7E2;
			padding: 30rpx;
			margin-bottom: 20rpx;

			.top {
				display: flex;
				flex-direction: column;
				margin-bottom: 40rpx;

				.title {
					text-align: center;
					font-size: 34rpx;
					font-weight: 700;
					color: #222222;
					margin-bottom: 13rpx;
				}

				.subtitle {
					display: flex;
					justify-content: center;
					align-items: center;

					text {
						font-size: 24rpx;
						color: #222;
						padding: 0 17rpx;
					}

					span {
						width: 88rpx;
						border: 1rpx solid #bdbdbd;
					}
				}
			}

			.recommend-goods {
				display: flex;
				flex-wrap: nowrap;
				margin-top: 40rpx;

				.item:nth-child(2) {
					margin: 0 17rpx;
				}

				.item {
					width: 219rpx;
					background-color: #FFFFFF;

					image {
						width: 219rpx;
						height: 219rpx;
						border-radius: 8rpx;
					}

					.name {
						text-overflow: -o-ellipsis-lastline;
						overflow: hidden;
						text-overflow: ellipsis;
						display: -webkit-box;
						-webkit-line-clamp: 1;
						-webkit-box-orient: vertical;
						font-size: 26rpx;
						color: #333;
						font-weight: bold;
						padding: 0rpx 8rpx 4rpx;
					}

					.price {
						font-size: 24rpx;
						font-weight: bold;
						color: #db4234;
						padding: 0 8rpx;
						padding-bottom: 20rpx;
					}

					.price::before {
						content: '￥';
						font-size: 20rpx;
					}
				}
			}
		}

		.search {
			margin: 12rpx 120rpx 0 20rpx;
		}

		.store {
			background-color: #ffffff;
			position: relative;
			display: flex;
			align-items: center;
			padding: 20rpx;
			margin-bottom: 20rpx;
			height: 136rpx;

			image {
				width: 74rpx;
				height: 74rpx;
				border-radius: 6rpx;
				margin-right: 20rpx;
			}

			.text {
				display: flex;
				flex-direction: column;
				flex: 1;
				min-width: 0;
				margin-right: 20rpx;

				.name {
					flex: 1;
					min-width: 0;
					overflow: hidden;
					white-space: nowrap;
					text-overflow: ellipsis;
					font-weight: bold;
					font-size: 32rpx;
					line-height: 1;
					color: #000;
				}

				.score {
					display: flex;
					align-items: center;
					margin-top: 17rpx;
					font-weight: 400;
					font-size: 24rpx;
					line-height: 1;
					color: #ffffff;
				}
			}

			.goodssum {
				display: flex;
				flex-direction: column;
				justify-content: center;

				.sum {
					text-align: center;
					font-size: 32rox;
					font-weight: bold;
					color: #000000;
				}

				.ww {
					font-size: 20rpx;
					color: #999999;
				}
			}
		}

		.main {
			flex: 1;
			min-height: 0rpx;
		}

		.goods-wrap {
			.top {
				display: flex;
				flex-direction: column;
				padding-bottom: 40rpx;
				background-color: #F6F6F6;

				.title {
					text-align: center;
					font-size: 34rpx;
					font-weight: 700;
					color: #222222;
					padding-bottom: 13rpx;
				}

				.subtitle {
					display: flex;
					justify-content: center;
					align-items: center;

					text {
						font-size: 24rpx;
						color: #222;
						padding: 0 17rpx;
					}

					span {
						width: 88rpx;
						border: 1rpx solid #bdbdbd;
					}
				}
			}
		}

		.goods {
			display: flex;
			flex-wrap: wrap;
			justify-content: space-between;
			padding-top: 20rpx;
			padding-right: 20rpx;
			padding-left: 20rpx;
			background-color: #f5f5f5;
			width: 750rpx;

			.item {
				width: 345rpx;
				border-radius: 16rpx;
				margin-bottom: 20rpx;
				background-color: #ffffff;
				overflow: hidden;

				.image {
					width: 345rpx;
					height: 345rpx;

					image {
						display: block;
						width: 100%;
						height: 100%;
					}
				}

				.text {
					padding: 20rpx 20rpx 25rpx;

					.name {
						overflow: hidden;
						white-space: nowrap;
						text-overflow: ellipsis;
						font-weight: 500;
						font-size: 30rpx;
						color: #222222;
					}

					.money-wrap {
						margin-top: 20rpx;

						.money {
							font-weight: bold;
							font-size: 26rpx;
							color: #e93323;

							text {
								font-size: 34rpx;
								line-height: 1;
							}
						}

						.label {
							display: flex;
							flex-wrap: wrap;

							.ticket {
								height: 26rpx;
								padding-right: 9rpx;
								padding-left: 9rpx;
								border: 1rpx solid #e93323;
								border-radius: 4rpx;
								margin-left: 10rpx;
								font-weight: 500;
								font-size: 20rpx;
								line-height: 24rpx;
								color: #e93323;
								margin-top: 17rpx;
							}

							.pinkage {
								height: 26rpx;
								padding-right: 9rpx;
								padding-left: 9rpx;
								border: 1px solid #6b78ab;
								border-radius: 4rpx;
								margin-left: 10rpx;
								font-weight: 500;
								font-size: 20rpx;
								line-height: 24rpx;
								color: #6b78ab;
								margin-top: 17rpx;
							}
						}
					}

					.score {
						margin-top: 20rpx;
						font-weight: 500;
						font-size: 20rpx;
						line-height: 1;
						color: #737373;
					}
				}

				.foot {
					display: flex;
					justify-content: center;
					align-items: center;
					height: 52rpx;
					background: linear-gradient(to right, #f11b09, #f67a38);
					font-weight: 500;
					font-size: 24rpx;
					color: #ffffff;

					.iconfont {
						margin-right: 10rpx;
						font-size: 22rpx;
						line-height: 1;
					}
				}
			}
		}

		.column {
			padding: 0;
			background-color: #f6f6f6;

			.item {
				position: relative;
				display: flex;
				align-items: center;
				justify-content: center;
				flex-direction: column;
				width: 100%;
				margin: 24rpx 30rpx;
				border-radius: 0;
				margin-bottom: 0;

				&::before {
					content: ' ';
					position: absolute;
					top: 0;
					right: 20rpx;
					left: 250rpx;
					border-top: 1rpx solid #f5f5f5;
				}

				.image {
					width: 100%;
					height: 380rpx;
					border-radius: 16rpx;
					overflow: hidden;
				}

				.text {
					position: relative;
					flex: 1;
					min-width: 0;
					padding: 24rpx;
					padding-bottom: 0;
					width: 100%;

					.name {
						white-space: pre-wrap;
						text-overflow: -o-ellipsis-lastline;
						overflow: hidden;
						text-overflow: ellipsis;
						display: -webkit-box;
						-webkit-line-clamp: 2;
						-webkit-box-orient: vertical;
						color: #282828;
					}

					.score {
						margin-bottom: 16rpx;
						margin-top: 0;
					}

					.money-wrap {
						display: flex;
						flex-direction: column;
						align-items: flex-start;
						margin-top: 0rpx;

						.money {
							display: flex;
							justify-content: space-between;
							width: 100%;
							align-items: center;

							.price {
								display: flex;

								i {
									margin-left: 16rpx;
									font-size: 20rpx;
									color: #999999;
									font-weight: 400;
								}
							}

							.buy {
								width: 180rpx;
								height: 58rpx;
								background: linear-gradient(90deg, #ed3420 2%, #f87547);
								border-radius: 29rpx;
								color: #FFFFFF;
								text-align: center;
								line-height: 58rpx;
							}
						}

						.label {
							margin-bottom: 16rpx;
						}

						.ticket {
							height: 28rpx;
							padding-right: 12rpx;
							padding-left: 12rpx;
							border: none;
							border-radius: 0;
							margin-top: 17rpx;
							margin-left: 0;
							background: url(@/static/images/yh.png) top left/100% 100% no-repeat;
							line-height: 28rpx;
						}

						.pinkage {
							height: 26rpx;
							padding-right: 9rpx;
							padding-left: 9rpx;
							border: 1px solid #6b78ab;
							border-radius: 4rpx;
							margin-left: 10rpx;
							margin-top: 17rpx;
							font-weight: 500;
							font-size: 20rpx;
							line-height: 24rpx;
							color: #6b78ab;
						}
					}
				}

				.foot {
					position: absolute;
					right: 20rpx;
					bottom: 30rpx;
					height: 44rpx;
					padding-right: 17rpx;
					padding-left: 17rpx;
					border-radius: 22rpx;
					font-size: 22rpx;
					color: #f5f5f5;
				}
			}
		}
	}

	.swiper-3d {

		.s-container {
			height: 460rpx;
			width: 100%;

			.swiper-item {
				display: block;
				position: relative;
				max-width: 460rpx;
				height: 100%;
				padding: 0rpx 14rpx;
				overflow: hidden;

			}

			.item-img {
				position: absolute;
				width: 460rpx;
				height: 80%;
				z-index: 5;
				top: 50%;
				transform: translateY(-50%);
			}

			.active {
				opacity: 1;
				z-index: 10;
				height: 460rpx;
				top: 0%;
				transition: all .1s ease-in 0s;
				transform: translateY(0);
			}
		}

		.text {
			text-align: center;
			padding-top: 24rpx;

			.name {
				margin: 0 auto;
				padding-bottom: 16rpx;
				font-size: 28rpx;
				width: 460rpx;
				overflow: hidden;
				white-space: nowrap;
				text-overflow: ellipsis;
				font-weight: bold;
			}

			.price {
				font-size: 28rpx;
				color: #db4234;
				font-weight: bold;
			}

			.price::before {
				content: '￥';
				font-size: 24rpx;
			}
		}
	}
	.bnt {
		position: fixed;
		z-index: 99;
		bottom: 0;
		width: 100%;
		height: 76rpx;
		display: flex;
		justify-content: space-between;
		.bnts {
			text-align: center;
			line-height: 76rpx;
			color: #fff;
			font-size: 28rpx;
			width: 100%;
			flex: 1;
		}
		.joinCart {
			border-radius: 0;
			background-image: linear-gradient(to right, #fea10f 0%, #fa8013 100%);
		}
		.buy {
			border-radius: 0;
			background-image: linear-gradient(to right, #fa6514 0%, #e93323 100%);
		}
		.buy[disabled] {
			background: #bbb;
		}
	}
</style>
